package com.HuiShou.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.HuiShou.mapper.UserPointsAccountMapper;
import com.HuiShou.domain.UserPointsAccount;
import com.HuiShou.service.IUserPointsAccountService;

/**
 * 积分账户Service业务层处理
 * 
 * @author lyz
 * @date 2025-03-21
 */
@Service
public class UserPointsAccountServiceImpl implements IUserPointsAccountService 
{
    @Autowired
    private UserPointsAccountMapper userPointsAccountMapper;

    /**
     * 查询积分账户
     * 
     * @param userId 积分账户主键
     * @return 积分账户
     */
    @Override
    public UserPointsAccount selectUserPointsAccountByUserId(Long userId)
    {
        return userPointsAccountMapper.selectUserPointsAccountByUserId(userId);
    }

    /**
     * 查询积分账户列表
     * 
     * @param userPointsAccount 积分账户
     * @return 积分账户
     */
    @Override
    public List<UserPointsAccount> selectUserPointsAccountList(UserPointsAccount userPointsAccount)
    {
        return userPointsAccountMapper.selectUserPointsAccountList(userPointsAccount);
    }

    /**
     * 新增积分账户
     * 
     * @param userPointsAccount 积分账户
     * @return 结果
     */
    @Override
    public int insertUserPointsAccount(UserPointsAccount userPointsAccount)
    {
        return userPointsAccountMapper.insertUserPointsAccount(userPointsAccount);
    }

    /**
     * 修改积分账户
     * 
     * @param userPointsAccount 积分账户
     * @return 结果
     */
    @Override
    public int updateUserPointsAccount(UserPointsAccount userPointsAccount)
    {
        return userPointsAccountMapper.updateUserPointsAccount(userPointsAccount);
    }

    /**
     * 批量删除积分账户
     * 
     * @param userIds 需要删除的积分账户主键
     * @return 结果
     */
    @Override
    public int deleteUserPointsAccountByUserIds(Long[] userIds)
    {
        return userPointsAccountMapper.deleteUserPointsAccountByUserIds(userIds);
    }

    /**
     * 删除积分账户信息
     * 
     * @param userId 积分账户主键
     * @return 结果
     */
    @Override
    public int deleteUserPointsAccountByUserId(Long userId)
    {
        return userPointsAccountMapper.deleteUserPointsAccountByUserId(userId);
    }
}
